<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;

class AdminMenu extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $model = new (config('admin.database.menu_model'));

        $app = $model->create([
            'order' => 3,
            'title' => '应用管理',
            'uri' => null,
        ]);
        $app->children()->createMany([
            ['order' => 1, 'title' => '应用管理', 'uri' => 'applications'],
            ['order' => 2, 'title' => '微信管理', 'uri' => 'wechats'],
            ['order' => 3, 'title' => '支付管理', 'uri' => 'payments'],
        ]);

        $aliyun = $model->create([
            'order' => 4,
            'title' => '云账户',
            'uri' => null,
        ]);
        $aliyun->children()->createMany([
            ['order' => 1, 'title' => '云账户管理', 'uri' => 'aliyun'],
            ['order' => 2, 'title' => '云存储', 'uri' => 'oss'],
            ['order' => 3, 'title' => '域名池', 'uri' => 'pools'],
            ['order' => 4, 'title' => 'SSL证书', 'uri' => 'ssl'],
            ['order' => 5, 'title' => '版本管理', 'uri' => 'versions'],
        ]);

        $vote = $model->create([
            'order' => 5,
            'title' => '活动管理',
            'uri' => null,
        ]);
        $vote->children()->createMany([
            ['order' => 1, 'title' => '活动管理', 'uri' => 'seasons'],
            ['order' => 2, 'title' => '场次管理', 'uri' => 'chapters'],
            ['order' => 3, 'title' => '选手管理', 'uri' => 'players'],
        ]);

        $data = $model->create([
            'order' => 6,
            'title' => '数据管理',
            'uri' => null,
        ]);
        $data->children()->createMany([
            ['order' => 1, 'title' => '点赞管理', 'uri' => 'likes'],
            ['order' => 2, 'title' => '评论管理', 'uri' => 'comments'],
            ['order' => 3, 'title' => '订单管理', 'uri' => 'orders'],
            ['order' => 4, 'title' => '退款管理', 'uri' => 'refunds'],
            ['order' => 5, 'title' => '打赏列表', 'uri' => 'supports'],
        ]);
    }
}
